﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Principal;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace _1Dot9MasterCommon
{
    public class AdminBasePage : System.Web.UI.Page
    {
        /// <summary>
        /// 로그인 체크 변수
        /// </summary>
        private bool isLogin = true;

        /// <summary>
        /// 로그인 체크 프로퍼티
        /// </summary>
        public bool IsLogin
        {
            get { return isLogin; }
            set { isLogin = value; }
        }

        /// <summary>
        /// 생성자
        /// </summary>
        public AdminBasePage()
        {
            try
            {
                if (string.IsNullOrEmpty(UserInfo.UserId))
                {
                    IsLogin = false;
                }
            }
            catch(Exception ex)
            {
                _1Dot9MasterCommon.CommonLogger.LogException(
                "_1Dot9MasterCommon.AdminBasePage.AdminBasePage()",
                ex.ToString(),
                false);
            }
        }

        /// <summary>
        /// 초기화 함수
        /// </summary>
        public void init()
        {
            try
            {
                if (IsLogin == false)
                {
                    Response.Redirect("~/Admin/Login.aspx", false);
                }
            }
            catch (Exception ex)
            {
                _1Dot9MasterCommon.CommonLogger.LogException(
                "_1Dot9MasterCommon.AdminBasePage.init()",
                ex.ToString(),
                false);
            }
        }
    }
}
